home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3biso9660backend.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.0 KB  |  96 lines

  1. /* 
  2.  *
  3.  * $Id: sourceheader 380067 2005-01-19 13:03:46Z trueg $
  4.  * Copyright (C) 2005 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_ISO9660_BACKEND_H_
  17. #define _K3B_ISO9660_BACKEND_H_
  18.  
  19. #include <qstring.h>
  20.  
  21. #include "k3b_export.h"
  22.  
  23. namespace K3bDevice {
  24.   class Device;
  25. }
  26.  
  27. class K3bLibDvdCss;
  28.  
  29.  
  30. class K3bIso9660Backend
  31. {
  32.  public:
  33.   K3bIso9660Backend() {}
  34.   virtual ~K3bIso9660Backend() {}
  35.  
  36.   virtual bool open() = 0;
  37.   virtual void close() = 0;
  38.   virtual bool isOpen() const = 0;
  39.   virtual int read( unsigned int sector, char* data, int len ) = 0;
  40. };
  41.  
  42.  
  43. class K3bIso9660DeviceBackend : public K3bIso9660Backend
  44. {
  45.  public:
  46.   LIBK3B_EXPORT K3bIso9660DeviceBackend( K3bDevice::Device* dev );
  47.   ~K3bIso9660DeviceBackend();
  48.  
  49.   bool open();
  50.   void close();
  51.   bool isOpen() const { return m_isOpen; }
  52.   int read( unsigned int sector, char* data, int len );
  53.  
  54.  private:
  55.   K3bDevice::Device* m_device;
  56.   bool m_isOpen;
  57. };
  58.  
  59.  
  60. class K3bIso9660FileBackend : public K3bIso9660Backend
  61. {
  62.  public:
  63.   LIBK3B_EXPORT K3bIso9660FileBackend( const QString& filename );
  64.   K3bIso9660FileBackend( int fd );
  65.   ~K3bIso9660FileBackend();
  66.  
  67.   bool open();
  68.   void close();
  69.   bool isOpen() const;
  70.   int read( unsigned int sector, char* data, int len );
  71.  
  72.  private:
  73.   QString m_filename;
  74.   int m_fd;
  75.   bool m_closeFd;
  76. };
  77.  
  78.  
  79. class K3bIso9660LibDvdCssBackend : public K3bIso9660Backend
  80. {
  81.  public:
  82.   LIBK3B_EXPORT K3bIso9660LibDvdCssBackend( K3bDevice::Device* );
  83.   ~K3bIso9660LibDvdCssBackend();
  84.  
  85.   bool open();
  86.   void close();
  87.   bool isOpen() const;
  88.   int read( unsigned int sector, char* data, int len );
  89.  
  90.  private:
  91.   K3bDevice::Device* m_device;
  92.   K3bLibDvdCss* m_libDvdCss;
  93. };
  94.  
  95. #endif
  96.